﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ASPNETMVCApplication.ActionServiceReference;
using ASPNETMVCApplication.Areas.Shop.Models;
namespace ASPNETMVCApplication.Areas.Supp.Models
{
    /// <summary>
    /// Static class that maps Product and Cart Model objects to 
    /// Data Transfer Objects (DTOs) and vice versa.
    /// This class contains extension methods only.
    /// </summary>
    public static class Mapper
    {

        public static CustomerModel ToModel(this Customer customer)
        {
            return new CustomerModel
            {
                
            };
        }

        public static Customer FromModel(this CustomerModel customerModel)
        {
            return new Customer
            {
                
            };
        }

        public static List<CustomerModel> ToModel(this List<Customer> customers)
        {
            var models = new List<CustomerModel>();
            if (customers != null && customers.Count > 0)
                customers.ForEach(s => models.Add(s.ToModel()));

            return models;
        }

        
    }
}